﻿<Page
    x:Class="Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views.Category"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels ="using:Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.ViewModels"
    mc:Ignorable="d">
    <Page.TopAppBar>
        <AppBar>
            <StackPanel Orientation="Horizontal">
                <Button Command="{Binding GoToHome}" Content="Home" Style="{StaticResource AppBarTextButtonStyle}" FontSize="26.667" Margin="40,0,0,0"/>
            </StackPanel>
        </AppBar>
    </Page.TopAppBar>

    <Grid Background="{StaticResource BackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="120"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="140"/>
                <ColumnDefinition  Width="*"/>
            </Grid.ColumnDefinitions>
            <Button Command="{Binding GoBack}" Grid.Column="0" Style="{StaticResource BackButtonStyle}" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" />
            <TextBlock Grid.Column="1" Style="{StaticResource PageHeaderTextStyle}" Text="{Binding CategoryTitle}" Margin="0" FontFamily="{StaticResource TitleFont}" Foreground="{StaticResource TitleBrush}" />
        </Grid>
        <Grid Grid.Row="2" Margin="120,0,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="650"/>
                <ColumnDefinition Width="20"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="450"/>
                    <RowDefinition Height="10"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Image Grid.Row="0" Source="{Binding CategoryImage}" Width="650" Height="450"/>
                <TextBlock Grid.Row="2" Margin="25,0,0,0" Text="{Binding CategoryDescription}" TextWrapping="Wrap" Foreground="Black" Style="{StaticResource BodyTextStyle}"/>
            </Grid>

            <ListView Grid.Column="2" SelectedItem="{Binding Selected,Mode=TwoWay}" ItemsSource="{Binding Projects}" HorizontalContentAlignment="Left">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid HorizontalAlignment="Left">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="173"/>
                                <ColumnDefinition Width="5"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" HorizontalAlignment="Left" Height="130" Width="173" Source="{Binding Image}" />
                            <Grid Grid.Column="2">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="5"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <TextBlock Grid.Row="0" Text="{Binding Name}" TextWrapping="Wrap" Style="{StaticResource GroupHeaderTextStyle}"/>
                                <TextBlock Grid.Row="2" Text="{Binding Description}" TextWrapping="Wrap" Style="{StaticResource TitleTextStyle}"/>
                            </Grid>
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>
    </Grid>
</Page>